<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>农资与农产品全程供应链物流平台-新增转运站点信息</title>
<meta name="kewywords" content="农资与农产品全程供应链物流平台"/>
<meta name="description" content="农资与农产品全程供应链物流平台"/>
<link href="css/style.css" type="text/css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="css/jquery-ui.css" />	
<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="js/dialog/lhgdialog.js?skin=default"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			if($("#selectId").val() != ""){
				setSelectedValue("stationType",$("#selectId").val());			
			}					
		});
		
		function check(val){
			if(val==1){
				if($("#stationId").val() == ""||$.trim($("#stationId").val()) == ""){
					$("#stationIdTip").html("<font color=\"red\">请填写站点编号</font>");
					return false;
				}else{
					$("#stationIdTip").html("<font color=\"red\"></font>");	
				}
			}
			if(val==2){
				if($("#stationName").val() == ""||$.trim($("#stationName").val()) == ""){
					$("#stationNameTip").html("<font color=\"red\">请填写站点名称</font>");
					return false;
				}else{
					$("#stationNameTip").html("<font color=\"red\"></font>");	
				}
			}
			if(val==3){
				if($("#stationArea").val() == ""||$.trim($("#stationArea").val()) == ""){
						$("#stationAreaTip").html("<font color=\"red\">请填写站点区域</font>");
						return false;
				}else{
					$("#stationAreaTip").html("<font color=\"red\"></font>");	
				}
			}
			if(val==4){
				if($("#stationLocation").val() == ""||$.trim($("#stationLocation").val()) == ""){
					$("#stationLocationTip").html("<font color=\"red\">请填写站点区域</font>");
					return false;
				}else{
					$("#stationLocationTip").html("<font color=\"red\"></font>");	
				}
			}
		}
						
		function saveCheck(){
			if($.trim($("#stationId").val()) == ""){
				showTip("请填写站点编号");
				return false;
			}
			if($.trim($("#stationName").val()) == ""){
				showTip("请填写站点名称");
				return false;
			}			
			if($.trim($("#stationArea").val()) == ""){
				showTip("请填写站点区域");
				return false;
			}
			if($.trim($("#stationLocation").val()) == ""){
				showTip("请填写站点地址");
				return false;
			}		
			$("#saveTransShipStation").submit();
		}
		function setSelectedValue(id,value){	
			var obj = document.getElementById(id);	
			for( var i = 0;obj.options.length > i; i++){
				if(obj.options[i].value == value){
					obj.options[i].selected = true;
					return;
				}
			}
		}
		function showTip(alertMessage){
			$.dialog({
				title: "提示",
			    time: 5,
			    lock: true,
			    content: alertMessage,
			    width: 160,
	    		height: 80
			});
		}
	</script>
</head>
<body>
<%@include file="top.jsp" %>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="187" height="37" bgcolor="#e0e0e0" class="brt bbt">
    	<div class="topleft fl">系统菜单栏</div>
    </td>
    <td bgcolor="#e7e7e7" class=" bbt">
    	<div class="topleft fl">
    		您现在的位置：<a href="#">首页</a>&nbsp;>&nbsp;<span>转运站点信息</span>
    	</div>
    </td>
  </tr>
  <tr>
    <td width="187" height="100%" valign="top" bgcolor="#FFFFFF" class="brt">
    <div class="left_bk"> 
           <div class="menu2">
            <%@include file="database_left.jsp" %>
        </div>
        </div></td>
    <td align="left" valign="top" bgcolor="#FFFFFF">
    <div class="content">
      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="38" style="background:url(images/zz_tit.jpg) left top repeat-x;">
          	<div class="tt_back fl">新增转运站点</div>
          	<div class="fr">
          		<img src="images/tit_right.jpg" alt="" width="103" height="38" />
          	</div>
          </td>
        </tr>
        <tr>
          <td class="borders btn">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
			  <tr>
			    <td bgcolor="#fffeee" style="border-bottom:#fee7bd solid 1px;" >
				<form id= "saveTransShipStation" action="saveTransShipStation" method="post">
				<s:hidden name="selectId" id="selectId"/>
				<div style="height:500px">
			    <table border="0" cellspacing="0" cellpadding="0" align="left" style="margin-top:20px;margin-left: 100px;margin-bottom: 20px; " >
			    	<tr style="height: 40px;">
			  			<td align="right" width="100px;"><span style="color: red">*</span>站点编号：</td>
			  			<td width="300px;">
			  				<input type="text" class="input_are" id="stationId" 
			  					name="transShipmentStation.id" value="${transShipmentStation.id}" onblur="check(1)"/><span id="stationIdTip"></span>
			  			</td>
			  		</tr>
			  		<tr style="height: 40px;">
			  			<td align="right" width="100px;"><span style="color: red">*</span>站点名称：</td>
			  			<td width="300px;">
			  				<input type="text" class="input_are w122" id="stationName" 
			  					name="transShipmentStation.stationName" value="${transShipmentStation.stationName}" onblur="check(2)"/><span id="stationNameTip"></span>
			  			</td>
			  		</tr>			  		
			  		<tr style="height: 40px;">
			  			<td align="right">站点类型：</td>
			  			<td width="300px;">
			  				<select id="stationType" name="transShipmentStation.stationType" class="input_are w122">
					    		<option value="铁路" selected="selected">铁路</option>
					    		<option value="空运">空运</option>
					    		<option value="海运">海运</option>
					    	</select>
					    </td>			  			
			  		</tr>
			  		<tr style="height: 40px;">
			  			<td align="right" width="100px;"><span style="color: red">*</span>站点区域：</td>
			  			<td width="300px;">
			  				<input type="text" class="input_are w122" id="stationArea" 
			  					name="transShipmentStation.stationArea" value="${transShipmentStation.stationArea}" onblur="check(3)"/><span id="stationAreaTip"></span>
			  			</td>
			  		</tr>			  		
			  		<tr style="height: 40px;">
			  			<td align="right" width="100px;"><span style="color: red">*</span>站点地址：</td>
			  			<td width="300px;">
			  				<input type="text" class="input_are w122" id="stationLocation" 
			  					name="transShipmentStation.stationLocation" value="${transShipmentStation.stationLocation}" style="width: 250px;" onblur="check(4)"/><span id="stationLocationTip"></span>
			  			</td>
			  		</tr>
			  		<tr style="height: 40px;">
			  			<td align="right" width="100px;">管理员编号：</td>
			  			<td width="300px;">
			  				<input type="text" class="input_are w122" id="stationAdminId" 
			  					name="transShipmentStation.stationAdminId" value="${transShipmentStation.stationAdminId}"/>
			  			</td>
			  		</tr>
			  		<tr style="height: 40px;">
			  			<td align="right" width="100px;">管理员名称：</td>
			  			<td width="300px;">
			  				<input type="text" class="input_are w122" id="stationAdmin" 
			  					name="transShipmentStation.stationAdmin" value="${transShipmentStation.stationAdmin}"/>
			  			</td>
			  		</tr>
			  		<tr style="height: 40px;">
			  			<td align="right" width="100px;">备注：</td>
			  			<td width="300px;">
			  				<input type="text" class="input_are w122" id="remark" 
			  					name="transShipmentStation.remark" value="${transShipmentStation.remark}" style="width: 250px;"/>
			  			</td>
			  		</tr>
			  		<tr style="height: 40px;">
			  			<td colspan="2" align="center" width="300px;">
			  			<input type="button" style="cursor: pointer;" class="buttons" value="保  存" onclick="saveCheck()"/>&nbsp;&nbsp;&nbsp;&nbsp;
			  			<input type="reset" style="cursor: pointer;" class="buttons" value="重  置" /></td>
			  		</tr>
			</table>
			</div>
			</form>
			</td>
			  </tr>
			    </table></td>
			  </tr>
			</table>
			</div>
			</td>
        </tr>
      </table>
<div class="bottom">版权所有：安徽朗坤物联网</div>
</body>
</html>